/* 获取商品信息 */
function getProduct(page){
    $.ajax({
        type:'get',
        url:'http://192.168.1.110:8088/api/list',
        data:{
            pageNo:page
        },
        success:function(result){
            if(result.resultCode == 1){
                let data = result.resultInfo
                let productHtml = template('productList',data)
                $('.product .container').append(productHtml)
            }
        }
    })
}

/* 点击商品，获取id，跳转到商品详情页面 */
function redirect(id){
    location.href = "../pages/productInfor.html?id="+id
}
let pageStr = location.search
let page = pageStr.split('=')[1]
getProduct(page)

